// register for texture
uniform sampler2D img : register(s0);

struct VertIn
{
	float4 pos		: POSITION;
	float2 texcoord	: TEXCOORD0;

};

struct VertOut
{
	float4 pos		: POSITION;
	float2 texcoord	: TEXCOORD0;
	float4 outColour: COLOR;
};

// Vertex Shader
VertOut mainVS(	VertIn input,
				uniform float4x4 worldViewProjMat,
				uniform float4	 ambientColour,
				uniform float4	 diffuseColour
				)
{
	// Initialise output with zero's
	VertOut output	= (VertOut)0;
	
	// World View Projection Matrix - OGRE is MATRIX by POS
	output.pos		= mul(worldViewProjMat, input.pos);

	// Calcuate Texture Coords
	output.texcoord	= input.texcoord;
	
	// Calculate normal
//	output.normal	= input.normal;
	
	output.outColour = diffuseColour + ambientColour;

	return output;
}

// Fragment Shader
float4 mainPS(	VertOut input) : COLOR0
{
	float4 myTex 	= tex2D(img, input.texcoord);
	
	return myTex;
}